<template>
    <div style="width:100%;height:100%;">
        <div style="width:100%;height:100%;" ref="container" class="xx-editor" ></div>
    </div>
</template>

<script>
import * as monaco from 'monaco-editor'
export default {
    data() {
        return {
            monacoEditor: null
        }
    },
    mounted() {
        this.initEditor()
    },
    methods: {
        initEditor() {
            // DOM进行操作的nextTick
            this.$nextTick(function() {
                this.monacoEditor = monaco.editor.create(this.$refs.container, {
                    language: 'html',
                    value: this.value,
                    theme: 'vs-dark',
                    automaticLayout: true

                })
            })
        }
    }
}
</script>

<style>

</style>
